package com.clkj.mobileinspector.ui.adapter;



import com.lws.basic.base.BaseFragment;

import java.util.List;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

/**
 * @松 on 2018/9/7 09:42
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> mFragments;
    private List<String> mTitle;
    public FragmentAdapter(FragmentManager fm, List<BaseFragment> fragmentList , List<String> title) {
        super(fm);
        mFragments = fragmentList;
        mTitle = title;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitle.get(position);
    }
}
